package com.web.star.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.github.pagehelper.PageInfo;
import com.web.star.eneity.TBMenu;
import com.web.star.service.SystemService;

@Controller
public class SystemController {
	
	@Autowired
	private SystemService systemService;
	
	@GetMapping("/sys/getMenus")
	@ResponseBody
	public List<TBMenu> getMenuList(){
		return systemService.selMenuList();
	}
	
	@RequestMapping(value="/sys/main",method=RequestMethod.GET)
	public String main() {
		return "/main";
	}
	
	@RequestMapping(value="/sys/menuList",method=RequestMethod.GET)
	public String menuList() {
		return "/admin/menuList";
	}
	
	@GetMapping("/sys/getMenusByPage")
	@ResponseBody
	public PageInfo<TBMenu> getMenuListByPage(){
		return systemService.selMenuListByPage();
	}
}
